package com.sky.service.admin.impl;


import com.sky.constant.BusinessStatusConstant;
import com.sky.service.admin.ShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

@Service("adminShopService")
public class ShopServiceImpl implements ShopService {


    @Qualifier("redisTemplate")
    @Autowired
    private RedisTemplate redisTemplate;



    /**
     * 获取营业状态
     *
     * @return
     */
    @Override
    public Long getStatus() {
        Long status = (Long) redisTemplate.opsForValue().get(BusinessStatusConstant.SHOP_STATUS);
        return status;
    }

    /**
     * 设置营业状态
     *
     * @param status
     */
    @Override
    public void setStatus(Long status) {
        redisTemplate.opsForValue().set(BusinessStatusConstant.SHOP_STATUS, status);
    }
}
